import 'package:base_flutter/base_flutter.dart';
import 'package:ls_work/emergency_event/emergency_event_model.dart';
import 'package:ls_work/emergency_event/response/emergency_event_detail_data.dart';
class EmergencyEventDetailViewModel extends BaseViewModel{
  dynamic id;
  EmergencyEventDetailViewModel(super.context,{required this.id});

  var model = EmergencyEventModel();
  EmergencyEventDetailData? detailInfo;

  Future<void> getDetailInfo() async {
    showLoadingState();
    try{
      detailInfo =  await model.eventDetail(id);
      showContent();
    }catch(e){
      showErrorState(e.toNetError());
    }
  }

  @override
  void onCreated() {
    super.onCreated();
    getDetailInfo();
  }
}